﻿using System;
using System.Html.DOM;

namespace enyo
{
    public class Popup : BasicPopup
    {
        /// <summary>
        /// Controls how the popup will be shown and hidden.
        /// auto/manual/transition
        /// </summary>
        public ShowHideMode ShowHideMode { get; set; }

        /// <summary>
        /// CSS class that will be applied when the popup is open
        /// </summary>
        public string OpenClassName { get; set; }

        /// <summary>
        /// If true, shows the keyboard before opening the popup. 
        /// Manual keyboard mode is enabled when the popup is opened and must be restored for the keyboard to work automatically. 
        /// It is most common to use this option when an Input should be focused when the keyboard is shown. 
        /// In this case, implement an onOpen handler for the popup and focus the input using the method forceFocusEnableKeyboard, 
        /// e.g., this.$.input.forceFocusEnableKeyboard();
        /// </summary>
        public bool ShowKeyboardWhenOpening { get; set; }


        /// <summary>
        /// Opens at the bottom, right of the specified control.
        /// </summary>
        /// <param name="ctrl"></param>
        /// <param name="inAlwaysBelow"></param>
        /// <param name="inAlign"></param>
        public void OpenAroundControl(Control ctrl)//TODO: inAlwaysBelow,  inAlign)
        {
        }

        /// <summary>
        /// Opens at the location specified by a location relative to the viewport.
        /// </summary>
        /// <param name="rect">rectangle specifying where to open the popup. May contain left, top or right, bottom properties. If both are specified left,top is used.</param>
        /// <param name="inReposition"></param>
        //TODO:inReposition
        public void OpenAt(Rectangle rect, object inReposition)
        {
        }

        /// <summary>
        /// Opens in the center of the viewport.
        /// </summary>
        public void OpenAtCenter()
        {
        }

        /// <summary>
        /// Opens at the location of the specified control. 
        /// If there is space, the popup's top, left corner will be displayed at the top, left position of the control. 
        /// Otherwise, the popup's bottom, right will be displayed at the bottom, right of the control.
        /// </summary>
        /// <param name="ctrl">Control at whose location the popup will open.</param>
        /// <param name="offset">Offset that may contain left and top properties to specify an offset relative to the location the popup would otherwise be positioned.</param>
        public void OpenAtControl(Control ctrl, Offset offset)
        {
        }

        /// <summary>
        /// Opens at the location of a mouse event (inEvent). 
        /// The popup's position is automatically constrained so that it does not display outside the viewport.
        /// </summary>
        /// <param name="domEvent"></param>
        /// <param name="offset"></param>
        public void OpenAtEvent(DomEvent domEvent, Offset offset)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="inDimensions">inDimensions can have {top, left, right, bottom, width, height}</param>
        public void OpenNear(object inDimensions)//TODO:, inAround, inAlwaysBelow)
        {
        }
    }
}
